module.exports = (str)=>{
    let rule = [
        {
            re:/&forall;/ig,
            val:'∀'
        },
        {
            re:/&part;/ig,
            val:'∂'
        },
        {
            re:/&exists;/ig, 
            val:'∃'
        },
        {
            re:/&empty;/ig, 
            val:'∅'
        },
        {
            re:/&nabla;/ig, 
            val:'∇'
        },
        {
            re:/&isin;/ig, 
            val:'∈'
        },
        {
            re:/&notin;/ig, 
            val:'∉'
        },
        {
            re:/&ni;/ig, 
            val:'∋'
        },
        {
            re:/&prod;/ig, 
            val:'∏'
        },
        {
            re:/&sum;/ig, 
            val:'∑'
        },
        {
            re:/&minus;/ig, 
            val:'−'
        },
        {
            re:/&lowast;/ig, 
            val:'∗'
        },
        {
            re:/&radic;/ig, 
            val:'√'
        },
        {
            re:/&prop;/ig, 
            val:'∝'
        },
        {
            re:/&infin;/ig, 
            val:'∞'
        },
        {
            re:/&ang;/ig, 
            val:'∠'
        },
        {
            re:/&and;/ig, 
            val:'∧'
        },
        {
            re:/&or;/ig, 
            val:'∨'
        },
        {
            re:/&cap;/ig, 
            val:'∩'
        },
        {
            re:/&cap;/ig, 
            val:'∪'
        },
        {
            re:/&int;/ig, 
            val:'∫'
        },
        {
            re:/&there4;/ig, 
            val:'∴'
        },
        {
            re:/&sim;/ig, 
            val:'∼'
        },
        {
            re:/&cong;/ig, 
            val:'≅'
        },
        {
            re:/&asymp;/ig, 
            val:'≈'
        },
        {
            re:/&ne;/ig, 
            val:'≠'
        },
        {
            re:/&le;/ig, 
            val:'≤'
        },
        {
            re:/&ge;/ig, 
            val:'≥'
        },
        {
            re:/&sub;/ig, 
            val:'⊂'
        },
        {
            re:/&sup;/ig, 
            val:'⊃'
        },
        {
            re:/&nsub;/ig, 
            val:'⊄'
        },
        {
            re:/&sube;/ig, 
            val:'⊆'
        },
        {
            re:/&supe;/ig, 
            val:'⊇'
        },
        {
            re:/&oplus;/ig, 
            val:'⊕'
        },
        {
            re:/&otimes;/ig, 
            val:'⊗'
        },
        {
            re:/&perp;/ig, 
            val:'⊥'
        },
        {
            re:/&sdot;/ig, 
            val:'⋅'
        },
        {
            re:/&Alpha;/ig, 
            val:'Α'
        },
        {
            re:/&Beta;/ig, 
            val:'Β'
        },
        {
            re:/&Gamma;/ig, 
            val:'Γ'
        },
        {
            re:/&Delta;/ig, 
            val:'Δ'
        },
        {
            re:/&Epsilon;/ig, 
            val:'Ε'
        },
        {
            re:/&Zeta;/ig, 
            val:'Ζ'
        },
        {
            re:/&Eta;/ig, 
            val:'Η'
        },
        {
            re:/&Theta;/ig, 
            val:'Θ'
        },
        {
            re:/&Iota;/ig, 
            val:'Ι'
        },
        {
            re:/&Kappa;/ig, 
            val:'Κ'
        },
        {
            re:/&Lambda;/ig, 
            val:'Λ'
        },
        {
            re:/&Mu;/ig, 
            val:'Μ'
        },
        {
            re:/&Nu;/ig, 
            val:'Ν'
        },
        {
            re:/&Xi;/ig, 
            val:'Ν'
        },
        {
            re:/&Omicron;/ig, 
            val:'Ο'
        },
        {
            re:/&Pi;/ig, 
            val:'Π'
        },
        {
            re:/&Rho;/ig, 
            val:'Ρ'
        },
        {
            re:/&Sigma;/ig, 
            val:'Σ'
        },
        {
            re:/&Tau;/ig, 
            val:'Τ'
        },
        {
            re:/&Upsilon;/ig, 
            val:'Υ'
        },
        {
            re:/&Phi;/ig, 
            val:'Φ'
        },
        {
            re:/&Chi;/ig, 
            val:'Χ'
        },
        {
            re:/&Psi;/ig, 
            val:'Ψ'
        },
        {
            re:/&Omega;/ig, 
            val:'Ω'
        },
        {
            re:/&alpha;/ig, 
            val:'α'
        },
        {
            re:/&beta;/ig, 
            val:'β'
        },
        {
            re:/&gamma;/ig, 
            val:'γ'
        },
        {
            re:/&delta;/ig, 
            val:'δ'
        },
        {
            re:/&epsilon;/ig, 
            val:'ε'
        },
        {
            re:/&zeta;/ig, 
            val:'ζ'
        },
        {
            re:/&eta;/ig, 
            val:'η'
        },
        {
            re:/&theta;/ig, 
            val:'θ'
        },
        {
            re:/&iota;/ig, 
            val:'ι'
        },
        {
            re:/&kappa;/ig, 
            val:'κ'
        },
        {
            re:/&lambda;/ig, 
            val:'λ'
        },
        {
            re:/&mu;/ig, 
            val:'μ'
        },
        {
            re:/&nu;/ig, 
            val:'ν'
        },
        {
            re:/&xi;/ig, 
            val:'ξ'
        },
        {
            re:/&omicron;/ig, 
            val:'ο'
        },
        {
            re:/&pi;/ig, 
            val:'π'
        },
        {
            re:/&rho;/ig, 
            val:'ρ'
        },
        {
            re:/&sigmaf;/ig, 
            val:'ς'
        },
        {
            re:/&sigma;/ig, 
            val:'σ'
        },
        {
            re:/&tau;/ig, 
            val:'τ'
        },
        {
            re:/&upsilon;/ig, 
            val:'υ'
        },
        {
            re:/&phi;/ig, 
            val:'φ'
        },
        {
            re:/&chi;/ig, 
            val:'χ'
        },
        {
            re:/&psi;/ig, 
            val:'ψ'
        },
        {
            re:/&omega;/ig, 
            val:'ω'
        },
        {
            re:/&thetasym;/ig, 
            val:'ϑ'
        },
        {
            re:/&upsih;/ig, 
            val:'ϒ'
        },
        {
            re:/&piv;/ig, 
            val:'ϖ'
        },
        {
            re:/&middot;/ig, 
            val:'·'
        },
        {
            re:/&nbsp;/ig,
            val:' '
        },
        {
            re:/&quot;/ig,
            val:"＂"
        },
        {
            re:/&amp;/ig,
            val:'&'
        },
        {
            re:/&lt;/ig,
            val:'＜'
        },
        {
            re:/&gt;/ig,
            val:'＞'
        },
        {
            re:/&#8226;/ig,
            val:'•'
        },
        {
            re:/&OElig;/ig, 
            val:'Œ'
        },
        {
            re:/&oelig;/ig, 
            val:'œ'
        },
        {
            re:/&Scaron;/ig, 
            val:'Š'
        },
        {
            re:/&scaron;/ig, 
            val:'š'
        },
        {
            re:/&Yuml;/ig, 
            val:'Ÿ'
        },
        {
            re:/&fnof;/ig, 
            val:'ƒ'
        },
        {
            re:/&circ;/ig, 
            val:'ˆ'
        },
        {
            re:/&tilde;/ig, 
            val:'˜'
        },
        {
            re:/&ensp;/ig,
            val: ''
        },
        {
            re:/&emsp;/ig,
            val: ''
        },
        {
            re:/&thinsp;/ig,
            val: ''
        },
        {
            re:/&zwnj;/ig,
            val: ''
        },
        {
            re:/&zwj;/ig,
            val: ''
        },
        {
            re:/&lrm;/ig,
            val: ''
        },
        {
            re:/&rlm;/ig,
            val: ''
        },
        {
            re:/&ndash;/ig, 
            val:'–'
        },
        {
            re:/&mdash;/ig, 
            val:'—'
        },
        {
            re:/&lsquo;/ig, 
            val:'‘'
        },
        {
            re:/&rsquo;/ig, 
            val:'’'
        },
        {
            re:/&sbquo;/ig, 
            val:'‚'
        },
        {
            re:/&ldquo;/ig, 
            val:'“'
        },
        {
            re:/&rdquo;/ig, 
            val:'”'
        },
        {
            re:/&bdquo;/ig, 
            val:'„'
        },
        {
            re:/&dagger;/ig, 
            val:'†'
        },
        {
            re:/&Dagger;/ig, 
            val:'‡'
        },
        {
            re:/&bull;/ig, 
            val:'•'
        },
        {
            re:/&hellip;/ig, 
            val:'…'
        },
        {
            re:/&permil;/ig, 
            val:'‰'
        },
        {
            re:/&prime;/ig, 
            val:'′'
        },
        {
            re:/&Prime;/ig, 
            val:'″'
        },
        {
            re:/&lsaquo;/ig, 
            val:'‹'
        },
        {
            re:/&rsaquo;/ig, 
            val:'›'
        },
        {
            re:/&oline;/ig, 
            val:'‾'
        },
        {
            re:/&euro;/ig, 
            val:'€'
        },
        {
            re:/&trade;/ig, 
            val:'™'
        },
        {
            re:/&larr;/ig, 
            val:'←'
        },
        {
            re:/&uarr;/ig, 
            val:'↑'
        },
        {
            re:/&rarr;/ig, 
            val:'→'
        },
        {
            re:/&darr;/ig, 
            val:'↓'
        },
        {
            re:/&harr;/ig, 
            val:'↔'
        },
        {
            re:/&crarr;/ig, 
            val:'↵'
        },
        {
            re:/&lceil;/ig, 
            val:'⌈'
        },
        {
            re:/&rceil;/ig, 
            val:'⌉'
        },
        {
            re:/&lfloor;/ig, 
            val:'⌊'
        },
        {
            re:/&rfloor;/ig, 
            val:'⌋'
        },
        {
            re:/&loz;/ig, 
            val:'◊'
        },
        {
            re:/&spades;/ig, 
            val:'♠'
        },
        {
            re:/&clubs;/ig, 
            val:'♣'
        },
        {
            re:/&hearts;/ig, 
            val:'♥'
        },
        {
            re:/&diams;/ig, 
            val:'♦'
        },
        {
            re:/&#39;/ig,
            val:"＇"
        },
        // {
        //     re:/\r\n/ig,
        //     val:""
        // },
        // {
        //     re:/\n/ig,
        //     val:""
        // }
    ];

    rule.forEach(item => {
        str = str.replace(item.re,item.val);
    });

    return str;
};